package com.xjscrm.console.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel("企微机器人返回对象")
public class WwDeviceVo {
    @ApiModelProperty("主键ID")
    private Long id;
    @ApiModelProperty("商户ID")
    private Long merId;
    @ApiModelProperty("机器人微信ID")
    private String deviceId;
    @ApiModelProperty("机器人微信昵称")
    private String deviceName;
    @ApiModelProperty("机器人微信头像")
    private String headImgUrl;
    @ApiModelProperty("备注")
    private String remark;
    @ApiModelProperty("手机号")
    private String mobile;
    @ApiModelProperty("手机号类型(0：电信，1：移动， 2：联通)")
    private Integer mobiletype;
    @ApiModelProperty("登录状态(0-离线，1-在线)")
    private Integer loginStatus;
    @ApiModelProperty("最后登录的IP地址")
    private String lastLoginIp;
    @ApiModelProperty("最后登录时间")
    private Integer lastLoginTime;
    @ApiModelProperty("创建时间")
    private Integer createTime;
    @ApiModelProperty("开启聊天, 0: 关闭, 1:开启")
    private Integer openChat;
    @ApiModelProperty("修改时间")
    private Integer updateTime;
    @ApiModelProperty("是否被接受新客方案使用（0-未使用，1-已使用）")
    private Integer useNewCustomerPlan;
    @ApiModelProperty("是否被新客运营方案使用-默认（0-未使用，1-已使用）")
    private Integer defaultCustomerPlanRule;
    @ApiModelProperty("是否被新客运营方案使用-条件（0-未使用，1-已使用）")
    private Integer conditionCustomerPlanRule;
    @ApiModelProperty("客户数")
    private Integer customerNum;
    @ApiModelProperty("分组")
    private List<String> groupNames;

    @ApiModelProperty("上次同步通讯录时间")
    private Integer lastSyncCustomerTime;
    @ApiModelProperty("上次同步客户群时间")
    private Integer lastSyncSuctomerGroupTime;

    @ApiModelProperty(value = "开启聊天",hidden = true)
    private String openChatDesc;

    @ApiModelProperty(value = "分组",hidden = true)
    private String groupNamesDesc;

    @ApiModelProperty("机器人所在群数")
    private Integer inGroupNum;

    @ApiModelProperty("企业id")
    private String corpId;

    @ApiModelProperty("获取会员外部账号频率")
    private Integer externalUseridRate;

    public void  setOpenChatDesc(){
        String str="";
        if(openChat==null){
            return;
        }
        if(openChat==0){
            str="离线";
        }
        if(openChat==1){
            str="在线";
        }
        this.openChatDesc=str;
    }

    public void  setGroupNamesDesc(){
        if(groupNames!=null&&!groupNames.isEmpty()){
            this.groupNamesDesc=String.join(",",groupNames);
        }
    }
}
